const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');

// Ensure the icons directory exists
const iconsDir = path.join(__dirname, '../public/icons');
if (!fs.existsSync(iconsDir)) {
  fs.mkdirSync(iconsDir, { recursive: true });
}

// Sizes to generate
const sizes = [16, 32, 48, 128];

// Convert SVG to PNG for each size
sizes.forEach(size => {
  console.log(`Generating ${size}x${size} icon...`);
  
  try {
    // You'd usually use a tool like Inkscape, ImageMagick, or svgexport
    // For this placeholder, we'd suggest manually creating icons or using a proper conversion tool
    console.log(`Please manually convert the SVG to a ${size}x${size} PNG file named icon-${size}.png`);
    
    // Example command if you have ImageMagick installed:
    // execSync(`convert -background none -size ${size}x${size} public/icons/icon.svg public/icons/icon-${size}.png`);
  } catch (error) {
    console.error(`Error generating ${size}x${size} icon:`, error.message);
  }
});

console.log('Icon generation complete. Please ensure all necessary icon sizes are available.'); 